﻿using System;

class Poker
{
    static void Main()
    {
        //Telerik Academy Exam 1 @ 29 Dec 2012
        // BGCoder result: 88/100

        string card1 = Console.ReadLine();
        string card2 = Console.ReadLine();
        string card3 = Console.ReadLine();
        string card4 = Console.ReadLine();
        string card5 = Console.ReadLine();

        if (card1 == card2 && card2 == card3 && card3 == card4 && card4 == card5)
        {
            Console.WriteLine("Impossible");
        }
        else if ((card1 != card2 && card2 == card3 && card3 == card4 && card4 == card5) ||        //card1 е различна
                (card1 != card2 && card1 == card3 && card3 == card4 && card4 == card5) ||        //card2 е различна
                (card1 == card2 && card2 != card3 && card2 == card4 && card4 == card5) ||        //card3 е различна
                (card1 == card2 && card2 == card3 && card3 != card4 && card3 == card5) ||        //card4 е различна
                (card1 == card2 && card2 == card3 && card3 == card4 && card4 != card5))            //card5 е различна
        {
            Console.WriteLine("Four of a Kind");
        }
        else if ((card1 == card2 && card2 == card3 && card3 != card4 && card4 == card5) ||         //1,2,3 / 4,5
                (card1 == card2 && card2 == card5 && card2 != card3 && card3 == card4) ||           //1,2,5 / 3,4
                (card1 == card4 && card4 == card5 && card1 != card2 && card2 == card3) ||           //1,4,5 / 2,3
                (card1 == card2 && card2 != card3 && card3 == card4 && card4 == card5) ||         //3,4,5 / 1,2
                (card1 == card5 && card1 != card2 && card2 == card3 && card3 == card4) ||         //2,3,4 / 1,5
                (card1 == card3 && card1 != card2 && card2 == card4 && card4 == card5) ||         //2,4,5 / 1,3
                (card1 == card4 && card1 != card2 && card2 == card3 && card3 == card5) ||         //2,3,5 / 1,4
                (card2 == card4 && card2 != card1 && card1 == card3 && card3 == card5) ||         //1,3,5 / 2,4
                (card2 == card5 && card2 != card1 && card1 == card3 && card3 == card4) ||         //1,3,4 / 2,5
                (card3 == card5 && card3 != card1 && card1 == card2 && card2 == card4))           //1,2,4 / 3,5
        {
            Console.WriteLine("Full House");
        }
        else if ((card1 == "A" && card2 == "2" && card3 == "3" && card4 == "4" && card5 == "5") ||
                (card1 == "2" && card2 == "3" && card3 == "4" && card4 == "5" && card5 == "6") ||
                (card1 == "3" && card2 == "4" && card3 == "5" && card4 == "6" && card5 == "7") ||
                (card1 == "4" && card2 == "5" && card3 == "6" && card4 == "7" && card5 == "8") ||
                (card1 == "5" && card2 == "6" && card3 == "7" && card4 == "8" && card5 == "9") ||
                (card1 == "6" && card2 == "7" && card3 == "8" && card4 == "9" && card5 == "10") ||
                (card1 == "7" && card2 == "8" && card3 == "9" && card4 == "10" && card5 == "J") ||
                (card1 == "8" && card2 == "9" && card3 == "10" && card4 == "J" && card5 == "Q") ||
                (card1 == "9" && card2 == "10" && card3 == "J" && card4 == "Q" && card5 == "K") ||
                (card1 == "10" && card2 == "J" && card3 == "Q" && card4 == "K" && card5 == "A"))
        {
            Console.WriteLine("Straight");
        }
        else if ((card1 == card2 && card2 == card3) || (card2 == card3 && card3 == card4) ||
                (card3 == card4 && card4 == card5) || (card1 == card2 && card2 == card4) ||
                (card1 == card2 && card2 == card5) || (card1 == card3 && card3 == card5) ||
                (card2 == card3 && card3 == card5) || (card1 == card4 && card4 == card5) ||
                (card2 == card4 && card4 == card5))
        {
            Console.WriteLine("Three of a Kind");
        }
        else if ((card1 == card2 && card3 == card4) || (card1 == card2 && card3 == card5) ||
                (card1 == card2 && card4 == card5) || (card2 == card3 && card4 == card5) ||
                (card2 == card3 && card1 == card4) || (card2 == card3 && card1 == card5) ||
                (card4 == card5 && card1 == card3) || (card1 == card3 && card2 == card4) ||
                (card1 == card3 && card2 == card5) || (card1 == card4 && card2 == card5) ||
                (card1 == card4 && card3 == card5) || (card1 == card5 && card2 == card4) ||
                (card1 == card5 && card3 == card4) || (card2 == card4 && card3 == card5) ||
                (card2 == card5 && card3 == card4))
        {
            Console.WriteLine("Two Pairs");
        }
        else if (card1 == card2 || card1 == card3 || card1 == card4 || card1 == card5 ||
                card2 == card3 || card2 == card4 || card2 == card5 || card3 == card4 || card3 == card5 ||
                card4 == card5)
        {
            Console.WriteLine("One Pair");
        }
        else
        {
            Console.WriteLine("Nothing");
        }


    }
}

